﻿@model WebUI.Models.EnumDefine
<table width="100%" cellpadding="0" cellspacing="0">
    <tr>
        <td>
            <div>
                <div class="titlebox">
                    @Html.FixStrMiddle(Model.EnumName,12) (@Html.Label(Model.EnumValues.Count.ToString()))

                </div>
                <div class="ctlbox">
                    @Ajax.ActionLink(" ", "EditEnum", new { ID = Model.EnumID, _utid = "enums" }, new AjaxOptions() { LoadingElementId="OnLoadingSpan",UpdateTargetId = "dialogbox", OnComplete = "showDialog('枚举');", HttpMethod = "Get", InsertionMode = InsertionMode.Replace, OnFailure = "OnSiteError" }, new { @class = "ui-icon ui-icon-pencil", style = "display:inline-block;" })
                    @Ajax.ActionLink(" ", "DelEnum", new { ID = Model.EnumID, _utid = "enums" }, new AjaxOptions() { LoadingElementId="OnLoadingSpan",UpdateTargetId = "enums", HttpMethod = "Get", InsertionMode = InsertionMode.Replace, OnFailure = "OnSiteError", Confirm = OnConfirmDel() }, new { @class = "ui-icon ui-icon-close", style = "display:inline-block;" })
                </div>
            </div>
        </td>
    </tr>
    <tr>
        <td style="">
            @{ int i = 0;
               foreach (var val in Model.EnumValues)
               {
                   if (i++ >= 3){ break;}
                <span style="white-space: nowrap; margin: 4px; background-color: whitesmoke">[@Html.DisplayFor(v => val.OptionValue)]
                    <span title="@(val.OptionDescription)">
                        @val.OptionTitle</span></span>
               }
               if(Model.EnumValues.Count>3)
               {
                   <span title="@(string.Join(";",Model.EnumValues.Select(v=>v.OptionTitle).ToArray()))">...</span>
               }
            }
        </td>
    </tr>
</table>
